package main
import "fmt"

/*定义一个全局变量试试*/
var i int

func main(){
	var num = 7
	var str = "yj"
	
	fmt.Printf("===========================================\n")
	fx1 := func(){
		fmt.Printf("num = %d\tstr = %s\n", num, str)
	}
	fx1()
	fx1()
	fx1()
	
	fmt.Printf("===========================================\n")
	fx2 := func(){
		num++
		str = "cryj"
	}
	fx2()
	fx1()
	fmt.Printf("===========================================\n")
	fx2()
	fx1()
	fmt.Printf("===========================================\n")
	fx2()
	fx1()
	fmt.Printf("===========================================\n")
	fx3 := func(){
		i = 5
	}
	fx3()
	fmt.Printf("i = %d\n",i)
	fmt.Printf("===========================================\n")
}
